"use strict";

var webpack = require("webpack");
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;

module.exports = {
    entry: {
        index: "./page/page-index.js"
    },
    output: {
        path: "../www/js",
        filename: "[name].js"
    },
    devtool: "source-map",
    resolve: {
        extensions: ["", ".webpack.js", ".web.js", ".ts", ".js"]
    },
    plugins: [
        new CommonsChunkPlugin("core.js", ["index"]),
        new webpack.optimize.UglifyJsPlugin({
            minimize: true
        })
    ],
    module: {
        loaders: [{
            test: /\.less$/,
            loader: "style!css!less"
        }, {
            test: /\.js$/,
            loader: "babel",
            exclude: /node_modules/,
            query: {
                presets: ["es2015"]
            }
        }]
    }
}
